import {HTagProps} from "@/components/ant-ext/HTag";

export class Const {
    select: { value: any, title: string }[]
    tag: HTagProps["mapping"]

    constructor(list: [key: any, text: string, color?: string][]) {
        this.tag = {}
        this.select = []
        for (let i in list) {
            const [key, text, color] = list[i]

            this.tag[key] = {text, color}
            this.select.push({title: text, value: key})
        }
    }
}


export const MenuType = new Const([
    [1, "链接", ""],
    [2, "菜单", ""],
    [3, "按钮", ""],
])
export const InnerPath = new Const([
    [true, "内部地址", ""],
    [false, "外部地址", ""],
])

export const Stat = new Const([
    [true, "启用", "blue"],
    [false, "禁用", "red"],
])

export const AdminStat = new Const([
    [0, "启用", "blue"],
    [1, "禁用", "red"],
    [2, "锁定", "warning"],
])
export const UserStat = new Const([
    [0, "禁用", "red"],
    [1, "未实名", ""],
    [3, "已实名", "blue"],
])
export const WithdrawalStat = new Const([
    ["AWAIT", "等待打款", ""],
    ["SUCCESS", "打款成功", "blue"],
    ["FAILURE", "无法打款", "red"],
])

export const PaymentStat = new Const([
    [true, "支付成功", "blue"],
    [false, "未支付", ""],
])
export const ContractType = new Const([
    ["Loan", "电子借条", "blue"],
    ["PartTime", "兼职合同", "green"],
    ["Renovation", "装修合同", "warning"],
])

export const ConfigType = new Const([
    [1, "键值", "green"],
    [2, "网页", "blue"],
])

export const ContractStat = new Const([
    ["RS1", "待确认", ""],
    ["RS2", "已拒绝", "red"],
    ["RS3", "进行中", "blue"],
    ["RS4", "已结清", "green"],
    ["RS5", "已取消", ""],
])